package com.mtnz.njk.Controller;

import com.mtnz.njk.Service.ManageService;
import com.mtnz.njk.config.FeignClients;
import org.mybatis.logging.Logger;
import org.mybatis.logging.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: app后台管理控制层(测试注解)
 * @Author: FBL
 * @CreateDate: 2019\7\31 0031 16:19
 * @Version: 1.0
 */
@RestController
@RequestMapping("/manage")
public class ManageController {
    private static Logger logger = LoggerFactory.getLogger(ManageController.class);

    @Autowired
    ManageService manageService;

    @Autowired
    FeignClients feignClient;

    @GetMapping("/get")
    public String get(String userId) {
        return manageService.getUserById(userId);
    }

    @GetMapping("/update")
    public String updateUserById(String userId, String nickName) {
        return manageService.updateUserById(userId, nickName);
    }

    @GetMapping("/del")
    public void delUserById(String userId) {
        manageService.delUserById(userId);
    }

    @GetMapping("/homeBanner")
    public String homeBanner() throws Exception {
        String s = feignClient.homeBanner();
        return s;
    }

}
